<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2022/6/2
  Time: 12:47
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>所有用户</title>
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
    <div class="row clearfix">
        <div class="col-md-12-column">
            <div class="page-header">
                <h1>
                    <small>用户列表----显示所有用户</small>
                </h1>
            </div>
        </div>

        <div class="row">
            <div class="col-md-4 column">
                <a class="btn btn-primary" href="${pageContext.request.contextPath}/user/toAddUser">新增</a>
            </div>
            <div class="col-md-offset-9 column">
                <form class="form-inline" action="${pageContext.request.contextPath}/user/queryUserByName"
                      method="post">
                    <input type="text" class="form-control" placeholder="请输入要查询的用户名" name="queryUserName">
                    <input type="submit" class="btn btn-primary" value="查询">
                </form>
            </div>
        </div>
    </div>
    <div class="row clearfix">
        <div class="col-md-12-column">
            <table class="table table-hover table-striped">
                <thead>
                <tr>
                    <th>用户编号</th>
                    <th>用户名字</th>
                    <th>用户密码</th>
                    <th>用户邮箱</th>
                    <th>用户生日</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <c:forEach var="user" items="${requestScope.get('list')}">
                    <tr>
                        <td>${user.id}</td>
                        <td>${user.name}</td>
                        <td>${user.password}</td>
                        <td>${user.email}</td>
                        <td>${user.birthday}</td>
                        <td>
                            <a href="${pageContext.request.contextPath}/user/toUpdate?id=${user.id}">修改</a>
                            &nbsp; | &nbsp;
                            <a href="${pageContext.request.contextPath}/user/deleteUserById/${user.id}">删除</a>
                        </td>
                    </tr>
                </c:forEach>
                </tbody>
            </table>
        </div>
    </div>

</div>
</body>
</html>
